#include <ros/ros.h>
#include <learning_topic/Person.h>

void personInfoCallback(const learning_topic::Person::ConstPtr &msg)
{
    ROS_INFO("Subscribe persion info: name:%s sex:%d age:%d", msg->name.c_str(), msg->sex, msg->age);
}

int main(int arg, char **args)
{
    ros::init(arg, args, "person_subscriber");

    ros::NodeHandle node;

    ros::Subscriber person_info_sub = node.subscribe("/person_info", 10, personInfoCallback);

    ros::spin();

    return 0;
}